﻿using System;

namespace TextEditor
{   
    public class A_DeleteTable : A_Action
    {
        public override string ActionName()
        {
            return "tabledelete";
        }

        public override A_Action Clone()
        {
            A_DeleteTable table = new A_DeleteTable();
            table.BaseCloneFrom(this);
            return table;
        }

        public override bool Execute()
        {
            if (base.OwnerDocument.Locked)
            {
                return false;
            }
            base.myOwnerDocument._DeleteTable();
            return true;
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.GetInTable(base.myOwnerDocument.Content.CurrentElement) == null ? false : true;
        }

        public override bool UIExecute()
        {
            base.myOwnerDocument._DeleteTable();
            return true;
        }
    }
}

